import shapefile

# 1. shp 内所有点的集合
r = shapefile.Reader("shapefiles/NYC_MUSEUMS/NYC_MUSEUMS_GEO")
shapes = r.shapes()
for item in shapes:
    print(item)

# 2.多有图形的数量
print(len(shapes))
# 3.取出集合内第7个图形
print(r.shape(3))
# 4.图形所包含的属性
for name in dir(shapes[3]):
    if not name.startswith('_'):
        print(name)
# 5.打印图形类型的代号和类型
print(shapes[3].shapeType)
print(shapes[3].shapeTypeName)
# 6.打印点的坐标
print(shapes[3].points)

r.close()